package com.yunweiweishi.xuhuanpaltform.yuhuan_app.comm.emun;

/**
 * @author
 */
public enum BusinessExceptionEnum {
    /**
     *
     */
    UNKNOWN_ERROR(500, "未知错误"),
    REQUEST_NOT_FOUND(404, "请求的页面不存在"),
    UNAUTHORIZED(401, "未授权"),
    REQUEST_FORBIDDEN(403, "无权限"),
    USER_LOGIN(406, "用户已经登录"),

    /**
     * 设备
     */
    EQUIPMENT_NOT_FOUND(2, "不存在该设备"),
    EQUIPMENT_QR_CODE_EXIST(3, "该设备二维码已经存在"),
    EQUIPMENT_SN_EXIST(3, "该设备SN已经存在"),
    /**
     * 公司
     */
    COMPANY_NOT_EXIST(1, "不存在该公司"),
    COMPANY_REGISTERED(1, "该公司已经被注册"),
    COMPANY_NAME_TOO_LONG(1, "公司名称只能在20字以内"),
    /**
     * 目录
     */
    DIRECTORY_NOT_EXIST(2, "该目录不存在"),

    /**
     * token异常
     */
    TOKEN_EXPIRED(700, "token过期"),
    MISSING_AUTH_HEADER(701, "缺少Authorization Header"),
    TOKEN_ERROR(702, "token验证失败"),

    /**
     * 签名异常
     */
    SIGN_ERROR(703, "签名验证失败"),
    /**
     * 用户
     */
    USER_DATA_ERROR(410, "用户数据不完整"),
    USER_PHONE_ERROR(411, "手机号已经被注册"),
    PHONE_NUMBER_EXIST(412, "手机号已经被注册"),
    PHONE_NUMBER_ERROR(413, "手机号格式不正确"),
    USER_ENTERPRISE_ERROR(414, "企业已经注册"),
    VERIFICATION_ERROR(415, "验证码输入错误"),
    VERIFICATION_EXPIRED(416, "验证码已失效"),
    VERIFICATION_NULL_ERROR(417, "验证码不能为空"),
    NEW_PASSWORD_NOT_MATCH(418, "两次密码不一致"),
    REGISTER_ERROR(419, "注册失败"),
    PASSWORD_CANNOT_BE_NULL(420, "密码不能为空"),
    NOT_INVITED(421, "您未被邀请"),
    NOT_THIS_APP_USER(422, "您无法登录此APP"),
    OLD_PASSWORD_INCORRECT(423, "原密码错误"),
    INSUFFICIENT_BALANCE(424, "公司余额不足，请尽快充值"),
    USER_NOT_EXIST(425, "不存在此用户"),
    AUTH_REQUEST_ERROR(426, "账号密码错误"),
    NOT_AUTH_ERROR(427, "账号不存在,请注册"),
    AUTH_REQUEST_NULL_ERROR(428, "手机号或者密码不能为空"),
    OLD_PASSWORD_NULL(429, "原密码不能为空"),
    PASSWORD_LENGTH_ERROR(430, "密码长度6-20个字符"),
    NEW_PASSWORD_CANNOT_BE_NULL(431, "新密码不能为空"),
    USERNAME_LENGTH_ERROR(432, "姓名长度1-10个字符"),
    PHONE_INVITED(433, "该手机号已经被邀请"),

    /**
     * 资源
     */
    OBJECT_NOT_EXIST(400, "你访问的资源不存在或已经被删除"),

    /**
     * 其他
     */
    MISSING_FILE_ERROR(400, "文件为空"),
    FILENAME_TOO_LONG(400,"文件名200个字符以内"),
    PERMISSION_DENIED(403, "您无权进行此操作"),

    /**
     * 支付相关
     */
    BAD_MONEY(400, "金额异常"),

    WXPAY_CALL_FAILED(400, "调用微信支付失败");

    private Integer code;
    private String message;

    BusinessExceptionEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

}
